<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>JavaScript：改变 HTML 图像</title>
	</head>
	<body>
		<script type="text/javascript">
			function changeImg(){
				imgElement = document.getElementById("changeImg")
				if(imgElement.src.match("imgg"))
				{
					imgElement.src = "./img/img1.jpg"
				}
				else
				{
					imgElement.src = "./img/imgg2.jpg"
				}
			}
		</script>
		<img src="./img/img1.jpg" onclick="changeImg()" id="changeImg" width="200px" height="200px" loading="lazy" >
	</body>
</html>
